package org.javaopenaccess.dao;

import org.javaopenaccess.model.Db4oSchema;
import org.javaopenaccess.model.InternalSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.db4o.Db4o;
import com.db4o.ObjectContainer;

public class Db4oFileTransactionManager extends AbstractDb4oTransactionManager{
	

	private Logger logger = LoggerFactory.getLogger(this.getClass().getName());
	
	public ObjectContainer startTransaction(InternalSession session, AbstractSupportDao dao){
		logger.info("Opening runtime schema transaction");
		ObjectContainer cont = Db4o.openFile(((Db4oSchema)session.getCurrentSchema()).getFilePath());
		logger.info("opened runtime schema transaction");
		return cont;
	}
}
